home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / programming / c / ue2sas10 / config!j next >
Text File  |  1978-11-24  |  6KB  |  186 lines

  1. <defines:
  2.     define(DOS_RESULT,buf39)
  3.     define(DOS_CMD,buf40)
  4.     define(ErrWin, buf77)            ..my buffers. Change if conflicting
  5.     define(YourCmd, buf78)
  6.     define(SASon, n77)
  7.     define(SrcBuf, n78)               ..holds buffer number of current 
  8.     define(ErrorLine, n79)          ..holds line num of current error
  9.     define(FIRST_ERR,6)
  10. >
  11.  
  12. run compiler on source in window
  13.  
  14. <shftAlt-j:
  15.     equateNum(SrcBuf,curFile)         ..make note of buffer with source code
  16.     freeBuf(DOS_CMD)
  17.     freeBuf(DOS_RESULT)
  18.     getFileName(DOS_CMD,buf[SrcBuf])     ..put source file and path string in DOS_CMD 
  19.     if (isEmpty(YourCmd)) {            ..if no string then make default
  20.         insertRgn(DOS_CMD,sFile,"sc:c/sc ",all)
  21.         ..equateLoc(YourCmd,eHilite,atCursor)
  22.         ..moveCursor(YourCmd,sLine)
  23.         ..equateLoc(YourCmd,sHilite,atCursor)
  24.     } else {
  25.         insertRgn(DOS_CMD,sFile,YourCmd,all)
  26.     }
  27.     if (!execute(DOS_RESULT,DOS_CMD)) returnFalse   ..if DOS error, end command
  28.     if (isEmpty(DOS_RESULT)) {
  29.         putMsg("No reply from AmigaDOS.")
  30.         return
  31.     }
  32.     downFlag(DOS_RESULT,changed)
  33.     freeBuf(ErrWin)
  34.     insertRgn(ErrWin,sFile,"Last error listed",all)
  35.     moveCursor(ErrWin,eLine)
  36.     insertChar(ErrWin,10)                ..put newline at end of line
  37.     insertChar(ErrWin,10)                ..put newline at end of line
  38.     insertChar(ErrWin,10)                ..put newline at end of line
  39.     if (!lineToLoc(DOS_RESULT,atCursor,FIRST_ERR)) {
  40.         splitWindow(DOS_RESULT,6)       ..reveal DOS error messages
  41.         return
  42.     }
  43.     freeBuf(ErrWin)
  44.     splitWindow(ErrWin,3)
  45.     editBuf(ErrWin)                      ..make small split ready for input
  46.     nameBuffer(ErrWin,"Compile errors")
  47.     runKey(shftAlt-k)
  48. >
  49.  
  50. goto next errorline
  51.  
  52. <shftAlt-k:
  53.     setSearch(".c")
  54.     if (search(DOS_RESULT,locA,locB,0)) {  ..look for "line"
  55.         incLoc(DOS_RESULT,locA)             ..find line number
  56.         incLoc(DOS_RESULT,locA)
  57.         incLoc(DOS_RESULT,locA)
  58.         moveCursor(DOS_RESULT,locA)         ..cursor to line number
  59.         toNumber(ErrorLine, DOS_RESULT)     ..convert int at cursor and assign to var
  60.         equateLoc(DOS_RESULT,sHilite,atCursor)  ..mark region for copying
  61.         moveCursor(DOS_RESULT,eLine)
  62.         equateLoc(DOS_RESULT,eHilite,atCursor)
  63.         insertRgn(ErrWin,atCursor,"line ",all)   
  64.         insertRgn(ErrWin,atCursor,DOS_RESULT,hilite) ..paste error message to window
  65.         toggle(windowSplit)
  66.         lineToLoc(buf[SrcBuf],atCursor,ErrorLine) ..put cur on error line in source
  67.         vScroll(atCursor)
  68.         equateLoc(buf[SrcBuf],sInvert,eInvert)
  69.         equateLoc(buf[SrcBuf],sInvert,atCursor)
  70.         moveCursor(buf[SrcBuf],eline)
  71.         equateLoc(buf[SrcBuf],eInvert,atCursor)
  72.         refreshDisplay
  73.         toggle(windowSplit)
  74.         insertChar(ErrWin,10)                ..insert linefeed char
  75.         insertChar(ErrWin,10)                ..insert linefeed char
  76.         insertChar(ErrWin,10)                ..insert linefeed char
  77.         return
  78.     }
  79.     putMsg("last error listed")
  80.     insertRgn(ErrWin,atCursor,"last error listed",all)   
  81.     insertChar(ErrWin,10)                ..insert linefeed char
  82.     insertChar(ErrWin,10)                ..insert linefeed char
  83.     insertChar(ErrWin,10)                ..insert linefeed char
  84. >
  85.  
  86. clean up error window
  87.  
  88. <shftAlt-l:
  89.     freeBuf(ErrWin)
  90.     runKey(lAmiga-0)                ..drop split window
  91.     putMsg("")                      ..wipe old message out
  92.     editBuf(buf[SrcBuf])
  93.     equateLoc(buf[SrcBuf],sInvert,eInvert)    ..remove inversion from source
  94.     refreshDisplay
  95. >
  96.  
  97. change command sent to DOS
  98.  
  99. <shftAlt-;:
  100.     ..swapKey(normal-buttonDown,shftAlt-2)
  101.     ..swapKey(normal-buttonUp,shftAlt-1)
  102.     putMsg("Enter new compile command <default: sc:c/sc>")
  103.     freeBuf(YourCmd)
  104.     if (!inputString(YourCmd)) {
  105.         insertRgn(YourCmd,sFile,"sc:c/sc ",all)
  106.     } else {
  107.         moveCursor(YourCmd,eLine)         ..cursor to line number
  108.         insertChar(YourCmd,32)                ..put space at end of line
  109.     }
  110.     ..swapKey(normal-buttonUp,shftAlt-1)
  111.     ..swapKey(normal-buttonDown,shftAlt-2)
  112.     equateLoc(YourCmd,eHilite,atCursor)
  113.     moveCursor(YourCmd,sLine)         ..cursor to line number
  114.     equateLoc(YourCmd,sHilite,atCursor)  ..mark region for copying
  115.     moveCursor(YourCmd,eLine)
  116. >
  117.  
  118. toggle SAS screen gadgets
  119.  
  120. <shftAltCtl-j:
  121.     if (eqNum(SASon,0)) {
  122.         swapKey(normal-gadget1,shftCtl-j)   ..swap gadgets to unused keys
  123.         swapKey(normal-gadget2,shftCtl-k)
  124.         swapKey(normal-gadget3,shftCtl-l)
  125.         
  126.         copyKey(normal-gadget1,shftAlt-j)   ..put SAS functions on gadgets
  127.         copyKey(normal-gadget2,shftAlt-k)
  128.         copyKey(normal-gadget3,shftAlt-l)
  129.         
  130.         gadgetName(1,"compile")
  131.         gadgetName(2,"next error")
  132.         gadgetName(3,"clean up")
  133.         gadgetName(4,"       ")
  134.         
  135.         equateNum(SASon,1)
  136.     } else {
  137.         swapKey(normal-gadget1,shftCtl-j)   ..restore gadgets
  138.         swapKey(normal-gadget2,shftCtl-k)
  139.         swapKey(normal-gadget3,shftCtl-l)
  140.         
  141.         gadgetName(1,"<Next File/MARK>")
  142.         gadgetName(2,"<Prev File/MARK>")
  143.         gadgetName(3,"<Down/SET MARK> ")
  144.         gadgetName(4,"<Up/INIT MARKS> ")
  145.  
  146.         equateNum(SASon,0)
  147.     }
  148. >
  149.  
  150. The following definitions have nothing to do with compiling.
  151. These add the capability of loading learn sequences onto
  152. kepad keys, so that they will operate as macro keys.
  153. Using these as a pattern one could load and run learn sequences
  154. on more of the numeric pad's keys.
  155.  
  156. <shftCtl-kpLParen:
  157.     saveLearn("T:uLearn.1")
  158.     putMsg("Learn put on kp-(")>
  159.     
  160. <shftAlt-kpLParen:
  161.     if (loadLearn("T:uLearn.1")) runLearn
  162.     else putMsg("Not found") >
  163.  
  164. <shftCtl-kpRParen:
  165.     saveLearn("T:uLearn.2")        
  166.     putMsg("Learn put on kp-)")>
  167.     
  168. <shftAlt-kpRParen:
  169.     if (loadLearn("T:uLearn.2")) runLearn
  170.     else putMsg("Not found") >
  171.     
  172. <shftCtl-kpSlash:
  173.     saveLearn("T:uLearn.3")
  174.     putMsg("Learn put on kp-/")>
  175.     
  176. <shftAlt-kpSlash:
  177.     if (loadLearn("T:uLearn.3")) runLearn
  178.     else putMsg("Not found") >
  179.     
  180. <shftCtl-kpStar:
  181.     saveLearn("T:uLearn.4")
  182.     putMsg("Learn put on kp-*")>
  183.  
  184. <shftAlt-kpStar:
  185.     if (loadLearn("T:uLearn.4")) runLearn
  186.     else putMsg("Not found") >